package com.jinzhi.jzweb.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.jinzhi.common.base.CoreService;
import com.jinzhi.common.utils.Result;
import com.jinzhi.jzapi.training.pojo.CoursesAndTeacherVo;
import com.jinzhi.jzapi.training.pojo.CoursesListVo;
import com.jinzhi.jzweb.domain.CoursesDO;
import com.jinzhi.jzweb.pojo.entity.Records;
import com.jinzhi.jzweb.pojo.request.CouresesRequest;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * 
 * <pre>
 * 课程表
 * </pre>
 * <small> 2020-02-24 21:00:12 | lance</small>
 */
public interface CoursesService extends CoreService<CoursesDO> {

    Page<CoursesListVo> selectListPage(int current, int number, Map map);

    CoursesAndTeacherVo selCourseDetail(Long id);

    List<Map> selCourseList(Map map);

    List<Map> selAllCourseList();

    List<Long> selCoursesIdList(Map map);

    /**
     * 资源分页查询
     * @param couresesRequest
     * @return
     */
    Result getCourseList(CouresesRequest couresesRequest);

    /**
     * 课程编码分页查询
     * @param number
     * @return
     */
    Result<Page<CoursesDO>> courseNumberList(String number,Page<CoursesDO> page);

    /**
     * 修改课程编码
     * @param course
     * @return
     */
    Result<String> updateCourseNumber(CoursesDO course);


    /**
     * 压缩包下载
     * @param coursesId
     * @return
     * @throws IOException
     */
    Result fileDownload(Long coursesId,HttpServletResponse response) throws IOException;


    /**
     * 资源效验
     * @param coursesId
     * @return
     */
    Result resourceEfficiency(Long coursesId);


    /**
     * 删除资源以及下面的章节文件信息
     * @param id
     * @return
     */
    Result removeById(Long id);

    int updateBrowseNumberById(String id);



    /**
     * 门户首页查询
     * @param queryParam
     * @return
     */
    Page<CoursesDO> indexSearch(String queryParam,Integer current, Integer size);
}
